#!/bin/sh

# 声明工作路径
workDir=$(cd "$(dirname "$0")/../" || exit; pwd)
# 是否有传入工作路径
if [ "$1" != "" ]
then
    workDir=$(cd "$(dirname "$1")/../" || exit; pwd)
fi

# 创建pkgconfig目录
mkdir -p "${workDir}/pkgconfig"

# 声明文件写入模板
template1="prefixDir=${workDir}
libDir=\${prefixDir}/lib
libName=maprule

Name: \${libName}
Description: Intelligent recognition model library by Graph AI
Version: 1.0
Libs: -L\${libDir} -l\${libName}
"

# 写入文件
echo "$template1" > "${workDir}/pkgconfig/maprule.pc"

# 声明文件写入模板
template2="prefixDir=${workDir}
libDir=\${prefixDir}/lib
libName=yoyoai

Name: \${libName}
Description: Intelligent recognition model library by Graph AI
Version: 1.0
Libs: -L\${libDir} -l\${libName}
"

# 写入文件
echo "$template2" > "${workDir}/pkgconfig/yoyoai.pc"
